<?php
function printr($data){
	echo '<pre>';
	print_r($data);
	echo '</pre>';
	exit;
}

function vardump($data){
	echo '<pre>';
	var_dump($data);
	echo '</pre>';
	exit;	
}

function get_thumb($image_name){
	if($image_name){
		$explode = explode('.',$image_name);
		return $explode[0].'_thumb.'.$explode[1];
	}
}

function get_video_url( $url ){
	if( $url ){
		if( strrpos( $url,'?v=') )
			$posv = strrpos( $url,'?v=' ) + 3;
		else
			$posv = strrpos( $url,'&v=' ) + 3;
		$result = substr( $url,$posv );
		//Remove all string begin &
		if( strpos($result,'&') !== FALSE ){
			$result = substr( $result,0,strpos($result,'&') );
		}
		return $result;
	}
	return false;
}

